import type { RouteRecordRaw } from 'vue-router';
import RouterView from '@/layout/routerView/index.vue';
import menu from '@/assets/menuIcon/menu6.png';

const moduleName = 'consumables';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/consumables',
    name: moduleName,
    component: RouterView,
    redirect: '/consumables/administration',
    meta: {
      title: '耗材管理',
      icon: menu,
    },
    children: [
      {
        path: 'administration',
        name: `${moduleName}-administration`,
        component: () => import('@/views/consumables/administration/index.vue'),
        meta: {
          title: '耗材库',
        },
      },
      {
        path: 'warehousing',
        name: `${moduleName}-warehousing`,
        component: () => import('@/views/consumables/warehousing/index.vue'),
        meta: {
          title: '耗材入库',
        },
      },
      {
        path: 'requisition',
        name: `${moduleName}-requisition`,
        component: () => import('@/views/consumables/requisition/index.vue'),
        meta: {
          title: '耗材领用/退还',
        },
      },
      {
        path: 'application',
        name: `${moduleName}-application`,
        component: () => import('@/views/purchase/application/index.vue'),
        meta: {
          title: '采购申请',
        },
      },

      {
        path: 'inventory',
        name: `${moduleName}-inventory`,
        component: () => import('@/views/purchase/inventory/index.vue'),
        meta: {
          title: '采购清单',
        },
      },
    ],
  },
];

export default routes;
